Added documentation for the target field `required-features`.
authorJames Bendig <jbendig@starbytesoftware.com>
Wed, 8 Feb 2017 21:30:24 +0000 (15:30 -0600)
committerJames Bendig <jbendig@starbytesoftware.com>
Wed, 8 Feb 2017 21:30:24 +0000 (15:30 -0600)
src/doc/manifest.md

index 8ee88efe2a3c8f1479275c9efc41693e59e63a23..d6e1aa12a5d4c194f5acba9d23d41fdfb95cae8a 100644 (file)
@@ -551,6 +551,24 @@ proc-macro = false
 harness = true
 ```
 
+## The `required-features` field (optional)
+
+The `required-features` field specifies which features must be selected for the
+target to be built. This is only relevant for the `[[bin]]`, `[[bench]]`,
+`[[test]]`, and `[[example]]` sections, it has no effect on `[lib]`.
+
+```toml
+[features]
+# ...
+postgres = []
+sqlite = []
+tools = []
+
+[[bin]]
+# ...
+required-features = ["postgres", "tools"]
+```
+
 # Building dynamic or static libraries
 
 If your project produces a library, you can specify which kind of library to